home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume18 / elm2.2 / part02 < prev    next >
Encoding:
Internet Message Format  |  1989-04-12  |  47.8 KB

  1. Subject:  v18i081:  Elm mail system, release 2.2, Part02/24
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: dsinc!syd@uunet.UU.NET (Syd Weinstein)
  7. Posting-number: Volume 18, Issue 81
  8. Archive-name: elm2.2/part02
  9.  
  10.  
  11. #!/bin/sh
  12. # this is part 2 of a multipart archive
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file Configure continued
  15. #
  16. CurArch=2
  17. if test ! -r s2_seq_.tmp
  18. then echo "Please unpack part 1 first!"
  19.      exit 1; fi
  20. ( read Scheck
  21.   if test "$Scheck" != $CurArch
  22.   then echo "Please unpack part $Scheck next!"
  23.        exit 1;
  24.   else exit 0; fi
  25. ) < s2_seq_.tmp || exit 1
  26. echo "x - Continuing file Configure"
  27. sed 's/^X//' << 'SHAR_EOF' >> Configure
  28. X        echo "(That doesn't agree with your whoami.h file, by the way.)"
  29. X        ;;
  30. X    *)
  31. X        echo "(That doesn't agree with your $phostname command, by the way.)"
  32. X        ;;
  33. X    esac
  34. X    phostname=''
  35. X    ;;
  36. X    esac
  37. X    ;;
  38. Xesac
  39. X
  40. X: decide how portable to be
  41. Xcase "$d_portable" in
  42. X"$define") dflt=y;;
  43. X*)    dflt=n;;
  44. Xesac
  45. X$cat <<'EOH'
  46. XI can set things up so that your shell scripts and binaries are more portable,
  47. Xat what may be a noticeable cost in performance.  In particular, if you
  48. Xask to be portable, the following happens:
  49. X
  50. X     1) shell scripts will rely on the PATH variable rather than using
  51. X    the paths derived above.
  52. X     2) ~username interpretations will be done at run time rather than
  53. X    by Configure.
  54. X     3) the system name will be determined at run time, if at all possible.
  55. X
  56. XEOH
  57. Xrp="Do you expect to run these scripts and binaries on multiple machines? [$dflt]"
  58. X$echo $n "$rp $c"
  59. X. myread
  60. Xcase "$ans" in
  61. X    y*) d_portable="$define"
  62. X    for file in $loclist; do
  63. X        eval $file=$file
  64. X    done
  65. X    ;;
  66. X    *)  d_portable="$undef" ;;
  67. Xesac
  68. X
  69. X: see if there is a whoami file
  70. Xecho " "
  71. Xif $test -r /usr/include/whoami.h ; then
  72. X    d_whoami="$define"
  73. X    echo "whoami.h found."
  74. Xelse
  75. X    d_whoami="$undef"
  76. Xfi
  77. X
  78. X: see how we will look up host name
  79. Xecho " "
  80. Xd_douname="$undef"
  81. Xd_gethname="$undef"
  82. Xif $test -z "$d_phostname"; then
  83. X    d_phostname="$undef"
  84. Xfi
  85. X
  86. Xif xenix; then
  87. X    if $test -n "$uname"; then
  88. X    u_name=`$uname -n`
  89. X    else
  90. X    u_name=
  91. X    fi
  92. X    if $test -n "$line"; then
  93. X    if $test -r /etc/systemid; then
  94. X        s_name=`$line < /etc/systemid`
  95. X    else
  96. X        s_name=
  97. X    fi
  98. X    else
  99. X    s_name=
  100. X    fi
  101. X    if $test -n "$u_name"; then
  102. X    if $test "$u_name" = "$s_name"; then
  103. X        cat <<EOM
  104. XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
  105. Xreturns the name compiled into the operating system via configure.
  106. XElm needs the UUCP name, and currently these two match.  However, they
  107. Xneed not match.  Be sure to always keep these two names in sync.
  108. XSince they match, Elm will not consider that the Xenix uname function
  109. Xis broken.  However, if you are not always able to make them
  110. Xmatch, answer the compile in hostname question Yes.
  111. XEOM
  112. X        if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  113. X        echo "uname() found."
  114. X        d_douname="$define"
  115. X        ans=uname
  116. X        fi
  117. X    else
  118. X        cat <<EOM
  119. XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
  120. Xreturns the name compiled into the operating system via configure.
  121. XYour /etc/systemid file contains $s_name.
  122. XBut uname returns $u_name.
  123. XSince Elm needs the UUCP name, and currently these two do not match,
  124. XElm will assume Xenix uname() is broken.
  125. XEOM
  126. X    fi
  127. X    else
  128. X    cat <<EOM
  129. XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
  130. Xreturns the name compiled into the operating system via configure.
  131. XElm needs the UUCP name, and currently the compiled in name is undefined.
  132. XSince mail needs the UUCP name, and these two need not match, Elm will
  133. Xassume Xenix uname() is broken.
  134. XEOM
  135. X    fi
  136. Xelif $contains '^gethostname$' libc.list >/dev/null 2>&1 ; then
  137. X    echo "gethostname() found."
  138. X    d_gethname="$define"
  139. X    ans=gethostname
  140. Xelif $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  141. X    echo "uname() found."
  142. X    d_douname="$define"
  143. X    ans=uname
  144. Xfi
  145. X
  146. Xcase "$d_douname$d_gethname" in
  147. X*define*)
  148. X    case "$d_host_comp" in
  149. X    "$define") dflt=y;;
  150. X    *)  dflt=n;;
  151. X    esac
  152. X    cat <<EOM
  153. XEvery now and then someone has a $ans() that lies about the hostname
  154. Xbut can't be fixed for political or economic reasons.  Would you like to
  155. XEOM
  156. X    rp="pretend $ans() isn't there and maybe compile in the hostname? [$dflt]"
  157. X    $echo $n "$rp $c"
  158. X    . myread
  159. X    case "$ans" in
  160. X    y*) d_douname="$undef" d_gethname="$undef"
  161. X    d_host_comp="$define"
  162. X    $echo $n "Okay... $c"
  163. X    ;;
  164. X    *)
  165. X    d_host_comp="$undef"
  166. X    ;;
  167. X    esac
  168. X    ;;
  169. Xesac
  170. X
  171. Xcase "$d_douname$d_gethname" in
  172. X*define*) ;;
  173. X*)
  174. X    case "$phostname" in
  175. X      '') ;;
  176. X      *)
  177. X    $cat <<EOT
  178. XThere is no gethostname() or uname() on this system.  You have two
  179. Xpossibilities at this point:
  180. X
  181. X1)  You can have your host name ($hostname) compiled into $package, which
  182. X    lets $package start up faster, but makes your binaries non-portable, or
  183. X2)  you can have $package use a
  184. X    
  185. X    popen("$phostname","r")
  186. X
  187. X    which will start slower but be more portable.
  188. X
  189. XOption 1 will give you the option of using whoami.h if you have one.  If you
  190. Xwant option 2 but with a different command, you can edit config.sh at the
  191. Xend of this shell script.
  192. X
  193. XEOT
  194. X    case "$d_phostname" in
  195. X    "$define") dflt=n;;
  196. X    "$undef")  dflt=y;;
  197. X    '')
  198. X        case "$d_portable" in
  199. X        "$define") dflt=n ;;
  200. X        *)      dflt=y ;;
  201. X        esac
  202. X        ;;
  203. X    esac
  204. X    rp="Do you want your host name compiled in? [$dflt]"
  205. X    $echo $n "$rp $c"
  206. X    . myread
  207. X    case "$ans" in
  208. X      n*) d_phostname="$define"
  209. X          d_host_comp="$undef"
  210. X          ;;
  211. X      *)  phostname=''
  212. X          d_host_comp="$define"
  213. X          d_phostname="$undef"
  214. X          ;;
  215. X    esac
  216. X    ;;
  217. X    esac
  218. X    case "$phostname" in
  219. X      '')
  220. X    case "$d_whoami" in
  221. X      "$define")
  222. X        dflt=y
  223. X        $cat <<EOM
  224. XNo hostname function--you can either use the whoami.h file, which has this line:
  225. X
  226. X    `grep sysname /usr/include/whoami.h`
  227. X
  228. Xor you can have the name we came up with earlier ($hostname) hardwired in.
  229. XEOM
  230. X        rp="Use whoami.h to get hostname? [$dflt]"
  231. X        $echo $n "$rp $c"
  232. X        . myread
  233. X        case "$ans" in
  234. X        n*) d_whoami="$undef";;
  235. X        esac
  236. X        ;;
  237. X      "$undef")
  238. X        echo 'No hostname function and no whoami.h--hardwiring "'$hostname'".'
  239. X        ;;
  240. X    esac
  241. X    ;;
  242. X    esac
  243. X    ;;
  244. Xesac
  245. X
  246. X: see if flock exists
  247. Xecho " "
  248. Xif $contains flock libc.list >/dev/null 2>&1; then
  249. X    echo 'flock() found.'
  250. X    if $contains EWOULDBLOCK /usr/include/errno.h > /dev/null 2>&1; then
  251. X    echo 'EWOULDBLOCK found, will use .lock and flock type mailbox locking'
  252. X        d_flock="$define"
  253. X    elif $contains EWOULDBLOCK /usr/include/sys/errno.h > /dev/null 2>&1; then
  254. X    echo 'EWOULDBLOCK found, will use .lock and flock type mailbox locking'
  255. X        d_flock="$define"
  256. X    else
  257. X    echo 'flock() not found--will use .lock type mailbox locking'
  258. X    d_flock="$undef"
  259. X    fi
  260. Xelse
  261. X    echo 'flock() not found--will use .lock type mailbox locking'
  262. X    d_flock="$undef"
  263. Xfi
  264. X
  265. X: see if getopt exists
  266. Xecho " "
  267. Xif $contains getopt libc.list >/dev/null 2>&1; then
  268. X    echo 'getopt() found.'
  269. X    d_getopt="$define"
  270. Xelse
  271. X    echo 'getopt() not found--will use our getopt instead.'
  272. X    d_getopt="$undef"
  273. Xfi
  274. X
  275. X: set up shell script to do ~ expansion
  276. Xcat >filexp <<EOSS
  277. X$startsh
  278. X: expand filename
  279. Xcase "\$1" in
  280. X ~/*|~)
  281. X    echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  282. X    ;;
  283. X ~*)
  284. X    if $test -f /bin/csh; then
  285. X    /bin/csh -f -c "glob \$1"
  286. X    echo ""
  287. X    else
  288. X    name=\`$expr x\$1 : '..\([^/]*\)'\`
  289. X    dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  290. X    if $test ! -d "\$dir"; then
  291. X        me=\`basename \$0\`
  292. X        echo "\$me: can't locate home directory for: \$name" >&2
  293. X        exit 1
  294. X    fi
  295. X    case "\$1" in
  296. X    */*)
  297. X        echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  298. X        ;;
  299. X    *)
  300. X        echo \$dir
  301. X        ;;
  302. X    esac
  303. X    fi
  304. X    ;;
  305. X*)
  306. X    echo \$1
  307. X    ;;
  308. Xesac
  309. XEOSS
  310. Xchmod +x filexp
  311. X$eunicefix filexp
  312. X
  313. X: determine pathnames of the domains, pathalias, L.sys or Systems
  314. Xcase "$pathalias" in
  315. X'') dflt=`loc paths blurfl/dyick $pth /usr/lib/uucp`
  316. X    if $test "$dflt" = blurfl/dyick; then
  317. X    dflt=`loc nmail.paths /usr/lib/nmail.paths $pth /usr/lib/uucp`
  318. X    fi
  319. X    ;;
  320. X*)  dflt="$pathalias";;
  321. Xesac
  322. Xcont=true
  323. Xwhile $test "$cont" ; do
  324. X    echo " "
  325. X    echo "Give the full path name of the pathalias"
  326. X    rp="data file? [$dflt]"
  327. X    $echo $n "$rp $c"
  328. X    . myread
  329. X    pathalias="$ans"
  330. X    if $test -f "$ans"; then
  331. X    cont=''
  332. X    else
  333. X    if $test "$fastread" = yes; then
  334. X        dflt=y
  335. X    else
  336. X        dflt=n
  337. X    fi
  338. X    echo "Pathalias data file $ans doesn't exist."
  339. X    rp="Use that name anyway? [$dflt]"
  340. X    $echo $n "$rp $c"
  341. X    . myread
  342. X    dflt=''
  343. X    case "$ans" in
  344. X    y*) cont='';;
  345. X    esac
  346. X    fi
  347. Xdone
  348. X
  349. Xcase "$domains" in
  350. X'') dflt=`loc domains /usr/lib/domains $pth /usr/lib/uucp`;;
  351. X*)  dflt="$domains";;
  352. Xesac
  353. Xcont=true
  354. Xwhile $test "$cont" ; do
  355. X    echo " "
  356. X    echo "Where does the uumail-style 'domains'"
  357. X    rp="file live? [$dflt]"
  358. X    $echo $n "$rp $c"
  359. X    . myread
  360. X    domains="$ans"
  361. X    if $test -f "$ans"; then
  362. X    cont=''
  363. X    else
  364. X    if $test "$fastread" = yes; then
  365. X        dflt=y
  366. X    else
  367. X        dflt=n
  368. X    fi
  369. X    echo "Domains data file $ans doesn't exist."
  370. X    rp="Use that name anyway? [$dflt]"
  371. X    $echo $n "$rp $c"
  372. X    . myread
  373. X    dflt=''
  374. X    case "$ans" in
  375. X    y*) cont='';;
  376. X    esac
  377. X    fi
  378. Xdone
  379. X
  380. Xcase "$lsysfile" in
  381. X'') dflt=`loc Systems blurfl/dyick /usr/lib/uucp`
  382. X    lsysvssys="Systems"
  383. X    if $test "$dflt" = blurfl/dyick; then
  384. X    dflt="/usr/lib/uucp/L.sys"
  385. X    lsysvssys="L.sys"
  386. X    fi
  387. X    ;;
  388. X*)  dflt="$lsysfile";;
  389. Xesac
  390. X
  391. X: is pathalias available as a dbm file
  392. Xd_havedbm="$undef"
  393. Xdbm=''
  394. X
  395. Xif $test -f "$pathalias.pag" -a -f "$pathalias.dir"; then
  396. X    ans=`loc libdbm.a x $libpth`
  397. X    if $test "$ans" = x; then
  398. X    dflt=y
  399. X    echo " "
  400. X    rp="You have pathalias as a DBM file, but I cannot find the
  401. XDBM library.  Do you have dbm? [$dflt]"
  402. X    $echo $n "$rp $c"
  403. X    . myread
  404. X    case "$ans" in
  405. X        y*|t*) d_havedbm="$define"
  406. X        echo " "
  407. X        echo "Then where are the dbm routines kept (specify either -llibname"
  408. X        $echo $n " or full pathname (~name ok))? $c"
  409. X        rp='Specify dbm library:'
  410. X        . myread
  411. X        dbm=`filexp $ans`
  412. X        ;;
  413. X        *)    d_havedbm="$undef"
  414. X        dbm=''
  415. X        echo "I will use the non dbm access methods then."
  416. X        ;;
  417. X    esac
  418. X    else
  419. X    echo " "
  420. X    echo "You have pathalias as a DBM file...I'll use that instead."
  421. X    dbm=$ans
  422. X    d_havedbm="$define"
  423. X    fi
  424. Xfi
  425. X
  426. X: index or strcpy
  427. Xecho " "
  428. Xcase "$d_index" in
  429. Xn) dflt=n;;
  430. X*) dflt=y;;
  431. Xesac
  432. Xif $contains '^index$' libc.list >/dev/null 2>&1 ; then
  433. X    if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  434. X    echo "Your system has both index() and strchr().  Shall I use"
  435. X    rp="index() rather than strchr()? [$dflt]"
  436. X    $echo $n "$rp $c"
  437. X    . myread
  438. X    case "$ans" in
  439. X        n*) d_index="$define" ;;
  440. X        *)  d_index="$undef" ;;
  441. X    esac
  442. X    else
  443. X    d_index="$undef"
  444. X    echo "index() found."
  445. X    fi
  446. Xelse
  447. X    if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  448. X    d_index="$define"
  449. X    echo "strchr() found."
  450. X    else
  451. X    echo "No index() or strchr() found!"
  452. X    d_index="$undef"
  453. X    fi
  454. Xfi
  455. X
  456. X: check for internet mailer
  457. Xcase "$d_internet" in
  458. X"$define")    dflt=y;;
  459. X"$undef")    dflt=n;;
  460. X*)    if $test -f "$sendmail"; then
  461. X        dflt=y
  462. X    elif $test -f "$smail"; then
  463. X        dflt=y
  464. X    else
  465. X        dflt=n
  466. X    fi
  467. X    ;;
  468. Xesac
  469. X$cat <<EOM
  470. XSome newer mailers can deliver mail to addresses of the INTERNET persuasion,
  471. Xsuch as user@host.UUCP.  Other older mailers require the complete path to
  472. Xthe destination to be specified in the address.  Does your mailer understand
  473. XEOM
  474. X$echo $n "INTERNET addresses? [$dflt] $c"
  475. Xrp="Does your mailer understand INTERNET addresses? [$dflt]"
  476. X. myread
  477. Xcase "$ans" in
  478. Xy*) d_internet="$define";;
  479. X*)  d_internet="$undef";;
  480. Xesac
  481. X
  482. Xcase "$d_mboxedit" in
  483. X"$define") dflt=y;;
  484. X"$undef")  dflt=n;;
  485. X*)    dflt=n;;
  486. Xesac
  487. X$cat <<EOM
  488. XA lot of sites that install the Elm Mail System find that the function
  489. XE)dit mailbox from within Elm is dangerous and confusing.  If you choose,
  490. Xyou can instead disable that function, with the program being slightly
  491. Xsmaller and presenting an appropriate error message to the user if they
  492. Xtry to E)dit their mailbox.
  493. X
  494. XEOM
  495. Xrp="Would you like to enable the E)dit Mailbox function? [$dflt]"
  496. X$echo $n "$rp $c"
  497. X. myread
  498. Xcase "$ans" in
  499. Xy*) d_mboxedit="$define";;
  500. X*)  d_mboxedit="$undef";;
  501. Xesac
  502. X
  503. X: see if mkdir exists
  504. Xecho " "
  505. Xif $contains '^mkdir$' libc.list >/dev/null 2>&1; then
  506. X    echo 'mkdir() found.'
  507. X    d_mkdir="$define"
  508. Xelse
  509. X    echo 'mkdir() not found.'
  510. X    d_mkdir="$undef"
  511. Xfi
  512. X
  513. X: ask about newmail running in the background automatically
  514. Xcase "$d_newauto" in
  515. X"$define")    dflt=y;;
  516. X"$undef")    dflt=n;;
  517. X*)        dflt=y;;
  518. Xesac
  519. Xecho " "
  520. Xrp="Should newmail automatically run in the background? [$dflt]"
  521. X$echo $n "$rp $c"
  522. X. myread
  523. Xcase "$ans" in
  524. Xy*) d_newauto="$define";;
  525. X*)  d_newauto="$undef";;
  526. Xesac
  527. X
  528. X: define d_useuuname, 
  529. Xif $test -f "$uuname"; then
  530. X    case "$d_useuuname" in
  531. X    "$define") dflt=y;;
  532. X    "$undef")  dflt=n;;
  533. X    *)       dflt=y;;
  534. X    esac
  535. X    $cat <<EOM
  536. X
  537. XShould the program use "uuname" rather than trying to read the
  538. X$lsysvssys file?
  539. XEOM
  540. X    echo " "
  541. X    rp="Should 'uuname' be used first? [$dflt]"
  542. X    $echo $n "$rp $c"
  543. X    . myread
  544. X    case "$ans" in
  545. X    y*) d_useuuname="$define";;
  546. X    *)  d_useuuname="$undef";;
  547. X    esac
  548. Xelse
  549. X    d_useuuname="$undef"
  550. Xfi
  551. X
  552. Xcase "$d_notouchadd" in
  553. X"$define") dflt=n;;
  554. X"$undef")  dflt=y;;
  555. X*)       dflt=y;;
  556. Xesac
  557. X$cat <<EOM
  558. X
  559. XSome sites are configured so that the low level transport mechanism
  560. Xis supposed to resolve and rewrite uucp paths, unreachable
  561. Xdomains/networks, and so on.  If your site running either "smail",
  562. Xa "gateway" configuration of sendmail, or some similar software
  563. Xthen the low level transport mechanism will resolve the uucp
  564. Xpaths.  In this case it is not necessary to have Elm resolve
  565. Xthe paths on outbound mail addresses.
  566. X
  567. XEOM
  568. Xecho " "
  569. Xrp="Should Elm resolve outbound addresses? [$dflt]"
  570. X$echo $n "$rp $c"
  571. X. myread
  572. Xcase "$ans" in
  573. Xy*) d_notouchadd="$undef";;
  574. X*)  d_notouchadd="$define";;
  575. Xesac
  576. X
  577. Xcase "$d_pafirst" in
  578. X"$define") dflt=y;;
  579. X"$undef")  dflt=n;;
  580. X*)       dflt=n;;
  581. Xesac
  582. Xif $test "$d_notouchadd" = "$undef"; then
  583. X    $cat <<EOM
  584. X
  585. XWhen given a machine that you talk to directly, should the 'pathalias'
  586. Xroute to the machine be used instead?"
  587. XEOM
  588. X    echo " "
  589. X    rp="Would you like to use pathalias route instead? [$dflt]"
  590. X    $echo $n "$rp $c"
  591. X    . myread
  592. X    case "$ans" in
  593. X    y*) d_pafirst="$define";;
  594. X    *)  d_pafirst="$undef";;
  595. X    esac
  596. Xelse
  597. X    d_pafirst="$undef"
  598. Xfi
  599. X
  600. Xif $test -f "$sendmail"; then
  601. X    echo "You're running sendmail.  Setting noaddfrom, nocheckvalid, usedomain"
  602. X    d_noaddfrom="$define"
  603. X    d_nocheckvalid="$define"
  604. X    d_usedomain="$undef"
  605. Xelse
  606. X    case "$d_nocheckvalid" in
  607. X    "$define") dflt=n;;
  608. X    "$undef")  dflt=y;;
  609. X    *)       dflt=y;;
  610. X    esac
  611. X
  612. X    $cat << EOM
  613. X
  614. XSince you're not running sendmail, should I check local user entered
  615. Xaddresses against the valid mailboxes on this system?
  616. XEOM
  617. X
  618. X    echo " "
  619. X    rp="Would you like to check local addresses? [$dflt]"
  620. X    $echo $n "$rp $c"
  621. X    . myread
  622. X    case "$ans" in
  623. X    y*) d_nocheckvalid="$undef";;
  624. X    *)  d_nocheckvalid="$define";;
  625. X    esac
  626. X
  627. X    case "$d_usedomain" in
  628. X    "$define") dflt=y;;
  629. X    "$undef")  dflt=n;;
  630. X    *)       dflt=y;;
  631. X    esac
  632. X
  633. X    $cat <<EOM
  634. X
  635. XAre you running a machine where you want to have a domain name appended
  636. Xto the hostname on outbound mail?
  637. XEOM
  638. X    echo " "
  639. X    rp="Would you like the domain name appended? [$dflt]"
  640. X    $echo $n "$rp $c"
  641. X    . myread
  642. X    case "$ans" in
  643. X    y*) d_usedomain="$define";;
  644. X    *)  d_usedomain="$undef";;
  645. X    esac
  646. X
  647. X    case "$d_noaddfrom" in
  648. X    "$define") dflt=y;;
  649. X    "$undef")  dflt=n;;
  650. X    *)       dflt=n;;
  651. X    esac
  652. X    echo " "
  653. X    rp="Does your mailer add the From: header for you? [$dflt]"
  654. X    $echo $n "$rp $c"
  655. X    . myread
  656. X    case "$ans" in
  657. X    y*) d_noaddfrom="$define";;
  658. X    *)  d_noaddfrom="$undef";;
  659. X    esac
  660. Xfi
  661. X
  662. X: ask about optimizing return addresses
  663. Xcase "$d_optreturn" in
  664. X"$define")    dflt=y;;
  665. X"$undef")    dflt=n;;
  666. X*)        dflt=n;;
  667. Xesac
  668. Xecho " "
  669. Xecho "Should I optimize the return address when you"
  670. Xrp="'alias current message'? [$dflt]"
  671. X$echo $n "$rp $c"
  672. X. myread
  673. Xcase "$ans" in
  674. Xy*) d_optreturn="$define";;
  675. X*)  d_optreturn="$undef";;
  676. Xesac
  677. X
  678. X: see if strings.h is in /usr/include or /usr/include/sys
  679. Xecho " "
  680. Xstrings=`loc strings.h "" /usr/include $includepath`
  681. Xif $test -z "$strings"; then
  682. X    strings=`loc string.h "" /usr/include $includepath`
  683. Xfi
  684. Xwhile $test -z "$strings"; do
  685. X    echo " "
  686. X    dflt=''
  687. X    rp="What is the full path name of the include file directory? []"
  688. X    $echo $n "$rp $c"
  689. X    . myread
  690. X    includepath=`filexp $ans`
  691. X    if $test -d "$includepath"; then
  692. X        strings=`loc strings.h "" /usr/include $includepath`
  693. X        if $test -z "$strings"; then
  694. X            strings=`loc string.h "" /usr/include $includepath`
  695. X        fi
  696. X        if $test -z "$strings"; then
  697. X            $cat <<EOM
  698. X
  699. XInclude file string.h or strings.h not found in $includepath.
  700. XElm requires string.h on USG type systems or strings.h on BSD type
  701. Xsystems.  Please specify the directory where one of these files can
  702. Xbe found.
  703. XEOM
  704. X        fi
  705. X    else
  706. X        echo "Directory $includepath not found"
  707. X    fi
  708. Xdone
  709. X
  710. Xstrings=`$expr "$strings" : ".*/\(.*\)"`
  711. Xif $test "$strings" = "string.h"; then
  712. X    d_strings="$undef"
  713. Xelse
  714. X    d_strings="$define"
  715. Xfi
  716. Xpwdinsys=`loc pwd.h "" /usr/include $includepath`
  717. Xif $test -z "$pwdinsys"; then
  718. X    d_pwdinsys="$define"
  719. Xelse
  720. X    d_pwdinsys="$undef"
  721. Xfi
  722. X
  723. X: get remove at last flag and number of lock attempts
  724. X$cat <<EOM
  725. X
  726. XThe next pair of questions have to do with what to do when another
  727. Xprogram has locked a mailbox...
  728. X
  729. XFirst, how many times should the Elm check for the removal of the lock
  730. Xfile before giving up?
  731. XEOM
  732. X
  733. Xcase "$maxattempts" in
  734. X    '') dflt=6;;
  735. X    *)  dflt=$maxattempts;;
  736. Xesac
  737. Xcont=true
  738. Xwhile $test "$cont" ; do
  739. X    echo " "
  740. X    rp="Number of lock attempts: [$dflt]"
  741. X    $echo $n "$rp $c"
  742. X    . myread
  743. X    maxattempts="$ans"
  744. X    if $test "$maxattempts" -lt 3 -o "$maxattempts" -gt 10 ; then
  745. X    echo "The recommended range is 3-10"
  746. X    odflt=$dflt
  747. X    dflt=n
  748. X    rp="Should I use your answer of $maxattempts lock attempts anyway? [$dflt]"
  749. X    $echo $n "$rp $c"
  750. X    . myread
  751. X    dflt=$odflt
  752. X    case "$ans" in
  753. X    y*) cont='';;
  754. X    esac
  755. X    else
  756. X    cont=''
  757. X    fi
  758. Xdone
  759. X
  760. Xcase "$d_remlock" in
  761. X"$define") dflt=y;;
  762. X"$undef")  dflt=n;;
  763. X*)       dflt=n;;
  764. Xesac
  765. Xecho " "
  766. Xrp="Should it REMOVE the lockfile after $maxattempts checks? [$dflt]"
  767. X$echo $n "$rp $c"
  768. X. myread
  769. Xcase "$ans" in
  770. Xy*) d_remlock="$define";;
  771. X*)  d_remlock="$undef";;
  772. Xesac
  773. X
  774. X: see if rename exists
  775. Xecho " "
  776. Xif $contains rename libc.list >/dev/null 2>&1; then
  777. X    echo 'rename() found.'
  778. X    d_rename="$define"
  779. Xelse
  780. X    echo 'rename() not found--will use our rename instead.'
  781. X    d_rename="$undef"
  782. Xfi
  783. X
  784. X: see if tempnam exists
  785. Xecho " "
  786. Xif $contains tempnam libc.list >/dev/null 2>&1; then
  787. X    echo 'tempnam() found.'
  788. X    d_tempnam="$define"
  789. Xelse
  790. X    echo 'tempnam() not found--will use our tempnam instead.'
  791. X    d_tempnam="$undef"
  792. Xfi
  793. X
  794. X: determine where manual pages go
  795. X$cat <<EOM
  796. XElm has manual pages that need to be installed in source form.
  797. X
  798. XEOM
  799. Xcase "$mansrc" in
  800. X'')
  801. X    dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1 /usr/man/man.L`
  802. X    ;;
  803. X*)  dflt="$mansrc"
  804. X    ;;
  805. Xesac
  806. Xcont=true
  807. Xwhile $test "$cont" ; do
  808. X    echo " "
  809. X    rp="Where do the manual pages (source) go? [$dflt]"
  810. X    $echo $n "$rp $c"
  811. X    . myread
  812. X    mansrc=`filexp "$ans"`
  813. X    if $test -d "$mansrc"; then
  814. X    cont=''
  815. X    else
  816. X    if $test "$fastread" = yes; then
  817. X        dflt=y
  818. X    else
  819. X        dflt=n
  820. X    fi
  821. X    rp="Directory $mansrc doesn't exist.  Use that name anyway? [$dflt]"
  822. X    $echo $n "$rp $c"
  823. X    . myread
  824. X    dflt=''
  825. X    case "$ans" in
  826. X    y*) cont='';;
  827. X    esac
  828. X    fi
  829. Xdone
  830. Xcase "$mansrc" in
  831. X*l)
  832. X    manext=l
  833. X    ;;
  834. X*n)
  835. X    manext=n
  836. X    ;;
  837. X*C)
  838. X    manext=C
  839. X    ;;
  840. X*L)
  841. X    manext=L
  842. X    ;;
  843. X*)
  844. X    manext=1
  845. X    ;;
  846. Xesac
  847. X
  848. X: see what memory models we can support
  849. Xcase "$models" in
  850. X'')
  851. X    : We may not use Cppsym or we get a circular dependency through cc.
  852. X    : But this should work regardless of which cc we eventually use.
  853. X    cat >pdp11.c <<'EOP'
  854. Xmain() {
  855. X#ifdef pdp11
  856. X    exit(0);
  857. X#else
  858. X    exit(1);
  859. X#endif
  860. X}
  861. XEOP
  862. X    cc -o pdp11 pdp11.c >/dev/null 2>&1
  863. X    if pdp11 2>/dev/null; then
  864. X    dflt='unsplit split'
  865. X    else
  866. X    ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
  867. X    case "$ans" in
  868. X    X) dflt='none';;
  869. X    *)  if $test -d /lib/small || $test -d /usr/lib/small; then
  870. X        dflt='small'
  871. X        else
  872. X        dflt=''
  873. X        fi
  874. X        if $test -d /lib/medium || $test -d /usr/lib/medium; then
  875. X        dflt="$dflt medium"
  876. X        fi
  877. X        if $test -d /lib/large || $test -d /usr/lib/large; then
  878. X        dflt="$dflt large"
  879. X        fi
  880. X        if $test -d /lib/huge || $test -d /usr/lib/huge; then
  881. X        dflt="$dflt huge"
  882. X        fi
  883. X    esac
  884. X    fi
  885. X    ;;
  886. X*)  dflt="$models" ;;
  887. Xesac
  888. X$cat <<EOM
  889. XSome systems have different model sizes.  On most systems they are called
  890. Xsmall, medium, large, and huge.  On the PDP11 they are called unsplit and
  891. Xsplit.  If your system doesn't support different memory models, say "none".
  892. XIf you wish to force everything to one memory model, say "none" here and
  893. Xput the appropriate flags later when it asks you for other cc and ld flags.
  894. XVenix systems may wish to put "none" and let the compiler figure things out.
  895. X(In the following question multiple model names should be space separated.)
  896. X
  897. XEOM
  898. Xrp="Which models are supported? [$dflt]"
  899. X$echo $n "$rp $c"
  900. X. myread
  901. Xmodels="$ans"
  902. X
  903. Xcase "$models" in
  904. Xnone)
  905. X    small=''
  906. X    medium=''
  907. X    large=''
  908. X    huge=''
  909. X    unsplit=''
  910. X    split=''
  911. X    ;;
  912. X*split)
  913. X    case "$split" in
  914. X    '') 
  915. X    if $contains '\-i' $mansrc/ld.1 >/dev/null 2>&1 || \
  916. X       $contains '\-i' $mansrc/cc.1 >/dev/null 2>&1; then
  917. X        dflt='-i'
  918. X    else
  919. X        dflt='none'
  920. X    fi
  921. X    ;;
  922. X    *) dflt="$split";;
  923. X    esac
  924. X    rp="What flag indicates separate I and D space? [$dflt]"
  925. X    $echo $n "$rp $c"
  926. X    . myread
  927. X    case "$ans" in
  928. X    none) ans='';;
  929. X    esac
  930. X    split="$ans"
  931. X    unsplit=''
  932. X    ;;
  933. X*large*|*small*|*medium*|*huge*)
  934. X    case "$models" in
  935. X    *large*)
  936. X    case "$large" in
  937. X    '') dflt='-Ml';;
  938. X    *) dflt="$large";;
  939. X    esac
  940. X    rp="What flag indicates large model? [$dflt]"
  941. X    $echo $n "$rp $c"
  942. X    . myread
  943. X    case "$ans" in
  944. X    none) ans='';
  945. X    esac
  946. X    large="$ans"
  947. X    ;;
  948. X    *) large='';;
  949. X    esac
  950. X    case "$models" in
  951. X    *huge*)
  952. X    case "$huge" in
  953. X    '') dflt='-Mh';;
  954. X    *) dflt="$huge";;
  955. X    esac
  956. X    rp="What flag indicates huge model? [$dflt]"
  957. X    $echo $n "$rp $c"
  958. X    . myread
  959. X    case "$ans" in
  960. X    none) ans='';
  961. X    esac
  962. X    huge="$ans"
  963. X    ;;
  964. X    *) huge="$large";;
  965. X    esac
  966. X    case "$models" in
  967. X    *medium*)
  968. X    case "$medium" in
  969. X    '') dflt='-Mm';;
  970. X    *) dflt="$medium";;
  971. X    esac
  972. X    rp="What flag indicates medium model? [$dflt]"
  973. X    $echo $n "$rp $c"
  974. X    . myread
  975. X    case "$ans" in
  976. X    none) ans='';
  977. X    esac
  978. X    medium="$ans"
  979. X    ;;
  980. X    *) medium="$large";;
  981. X    esac
  982. X    case "$models" in
  983. X    *small*)
  984. X    case "$small" in
  985. X    '') dflt='none';;
  986. X    *) dflt="$small";;
  987. X    esac
  988. X    rp="What flag indicates small model? [$dflt]"
  989. X    $echo $n "$rp $c"
  990. X    . myread
  991. X    case "$ans" in
  992. X    none) ans='';
  993. X    esac
  994. X    small="$ans"
  995. X    ;;
  996. X    *) small='';;
  997. X    esac
  998. X    ;;
  999. X*)
  1000. X    echo "Unrecognized memory models--you may have to edit Makefile.SH"
  1001. X    ;;
  1002. Xesac
  1003. X
  1004. X: see if we need a special compiler
  1005. Xecho " "
  1006. Xif usg; then
  1007. X    case "$cc" in
  1008. X    '')
  1009. X    case "$Mcc" in
  1010. X    /*) dflt='Mcc'
  1011. X        ;;
  1012. X    *)
  1013. X        case "$large" in
  1014. X        -M*)
  1015. X        dflt='cc'
  1016. X        ;;
  1017. X        *)
  1018. X        if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1019. X            dflt='cc -M'
  1020. X        else
  1021. X            dflt='cc'
  1022. X        fi
  1023. X        ;;
  1024. X        esac
  1025. X        ;;
  1026. X    esac
  1027. X    ;;
  1028. X    *)  dflt="$cc";;
  1029. X    esac
  1030. X    $cat <<'EOM'
  1031. XOn some systems the default C compiler will not resolve multiple global
  1032. Xreferences that happen to have the same name.  On some such systems the
  1033. X"Mcc" command may be used to force these to be resolved.  On other systems
  1034. Xa "cc -M" command is required.  (Note that the -M flag on other systems
  1035. Xindicates a memory model to use!)  If you have the Gnu C compiler, you
  1036. Xmight wish to use that instead.  What command will force resolution on
  1037. XEOM
  1038. X    $echo $n "this system? [$dflt] $c"
  1039. X    rp="Command to resolve multiple refs? [$dflt]"
  1040. X    . myread
  1041. X    cc="$ans"
  1042. Xelse
  1043. X    case "$cc" in
  1044. X    '') dflt=cc;;
  1045. X    *) dflt="$cc";;
  1046. X    esac
  1047. X    rp="Use which C compiler? [$dflt]"
  1048. X    $echo $n "$rp $c"
  1049. X    . myread
  1050. X    cc="$ans"
  1051. Xfi
  1052. Xcase "$cc" in
  1053. Xgcc*) cpp=`loc gcc-cpp $cpp $pth`;;
  1054. Xesac
  1055. X
  1056. X: determine optimize, if desired, or use for debug flag also
  1057. Xcase "$optimize" in
  1058. X' ') dflt="none"
  1059. X     ;;
  1060. X'') dflt="-O";
  1061. X    ;;
  1062. X*)  dflt="$optimize"
  1063. X    ;;
  1064. Xesac
  1065. Xcat <<EOH
  1066. XSome C compilers have problems with their optimizers, by default, Elm compiles
  1067. Xwith the -O flag to use the optimizer.  Alternately, you might want to use the
  1068. Xsymbolic debugger, which uses the -g flag.  Either flag can be specified here.
  1069. XTo use neither flag, specify the word "none".
  1070. X
  1071. XEOH
  1072. Xrp="What optimizer/debugger flag should be used? [$dflt]"
  1073. X$echo $n "$rp $c"
  1074. X. myread
  1075. Xoptimize="$ans"
  1076. Xcase "$optimize" in
  1077. X'none') optimize=" "
  1078. X     ;;
  1079. Xesac
  1080. X
  1081. Xcase "$ccflags" in
  1082. X'') dflt='none';;
  1083. X*) dflt="$ccflags";;
  1084. Xesac
  1085. Xecho " "
  1086. Xrp="Any additional cc flags? [$dflt]"
  1087. X$echo $n "$rp $c"
  1088. X. myread
  1089. Xcase "$ans" in
  1090. Xnone) ans='';
  1091. Xesac
  1092. Xccflags="$ans"
  1093. X
  1094. Xcase "$ldflags" in
  1095. X'') if venix; then
  1096. X    dflt='-i -z'
  1097. X    else
  1098. X    dflt='none'
  1099. X    fi
  1100. X    ;;
  1101. X*) dflt="$ldflags";;
  1102. Xesac
  1103. Xecho " "
  1104. Xrp="Any additional ld flags? [$dflt]"
  1105. X$echo $n "$rp $c"
  1106. X. myread
  1107. Xcase "$ans" in
  1108. Xnone) ans='';
  1109. Xesac
  1110. Xldflags="$ans"
  1111. Xrmlist="$rmlist pdp11"
  1112. X
  1113. Xcase "$libs" in
  1114. X'') dflt='none';;
  1115. X*) dflt="$libs";;
  1116. Xesac
  1117. X
  1118. X$cat <<'EOM'
  1119. XSome versions of Unix support shared libraries, which make
  1120. Xexecutables smaller but make load time slightly longer.
  1121. X
  1122. XOn some systems, mostly newer Unix System V's, the shared library
  1123. Xis included by putting the option "-lc_s" as the last thing on the
  1124. Xcc command line when linking.  Other systems use shared libraries
  1125. Xby default.  There may be other libraries needed to compile Elm
  1126. Xon your machine as well.  If your system needs the "-lc_s" option,
  1127. Xinclude it here.  Include any other special libraries here as also.
  1128. XEOM
  1129. X
  1130. Xecho " "
  1131. Xrp="Any additional libraries? [$dflt]"
  1132. X$echo $n "$rp $c"
  1133. X. myread
  1134. Xcase "$ans" in
  1135. Xnone) ans='';
  1136. Xesac
  1137. Xlibs="$ans"
  1138. X
  1139. X: see how we invoke the C preprocessor
  1140. Xecho " "
  1141. Xecho "Now, how can we feed standard input to your C preprocessor..."
  1142. Xcat <<'EOT' >testcpp.c
  1143. X#define ABC abc
  1144. X#define XYZ xyz
  1145. XABC.XYZ
  1146. XEOT
  1147. Xecho 'Maybe "'"$cc"' -E" will work...'
  1148. X$cc -E <testcpp.c >testcpp.out 2>&1
  1149. Xif $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1150. X    echo "Yup, it does."
  1151. X    cppstdin="$cc -E"
  1152. X    cppminus='';
  1153. Xelse
  1154. X    echo 'Nope, maybe "'$cpp'" will work...'
  1155. X    $cpp <testcpp.c >testcpp.out 2>&1
  1156. X    if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1157. X    echo "Yup, it does."
  1158. X    cppstdin="$cpp"
  1159. X    cppminus='';
  1160. X    else
  1161. X    echo 'No such luck...maybe "'$cpp' -" will work...'
  1162. X    $cpp - <testcpp.c >testcpp.out 2>&1
  1163. X    if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1164. X        echo "It works!"
  1165. X        cppstdin="$cpp"
  1166. X        cppminus='-';
  1167. X    else
  1168. X        echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
  1169. X        $cc -E - <testcpp.c >testcpp.out 2>&1
  1170. X        if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1171. X        echo "Hooray, it works!  I was beginning to wonder."
  1172. X        cppstdin="$cc -E"
  1173. X        cppminus='-';
  1174. X        else
  1175. X        echo 'Nope...maybe "'"$cc"' -P" will work...'
  1176. X        $cc -P <testcpp.c >testcpp.out 2>&1
  1177. X        if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1178. X            echo "Yup, that does."
  1179. X            cppstdin="$cc -P"
  1180. X            cppminus='';
  1181. X        else
  1182. X            echo 'Nope...maybe "'"$cc"' -P -" will work...'
  1183. X            $cc -P - <testcpp.c >testcpp.out 2>&1
  1184. X            if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1185. X            echo "Yup, that does."
  1186. X            cppstdin="$cc -P"
  1187. X            cppminus='-';
  1188. X            else
  1189. X            echo 'Hmm...perhaps you already told me...'
  1190. X            case "$cppstdin" in
  1191. X            '') ;;
  1192. X            *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
  1193. X            esac
  1194. X            if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1195. X                echo "Hooray, you did!  I was beginning to wonder."
  1196. X            else
  1197. X                echo 'Uh-uh.  Time to get fancy...'
  1198. X                cd ..
  1199. X                echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
  1200. X                echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
  1201. X                chmod 755 cppstdin
  1202. X                cppstdin=`pwd`/cppstdin
  1203. X                cppminus='';
  1204. X                cd UU
  1205. X                $cppstdin <testcpp.c >testcpp.out 2>&1
  1206. X                if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1207. X                echo "Eureka!."
  1208. X                else
  1209. X                dflt=blurfl
  1210. X                $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
  1211. X                rp='Name a C preprocessor:'
  1212. X                . myread
  1213. X                cppstdin="$ans"
  1214. X                $cppstdin <testcpp.c >testcpp.out 2>&1
  1215. X                if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1216. X                    echo "OK, that will do."
  1217. X                else
  1218. X                    echo "Sorry, I can't get that to work.  Go find one."
  1219. X                    exit 1
  1220. X                fi
  1221. X                fi
  1222. X            fi
  1223. X            fi
  1224. X        fi
  1225. X        fi
  1226. X    fi
  1227. X    fi
  1228. Xfi
  1229. Xrm -f testcpp.c testcpp.out
  1230. X
  1231. X: get C preprocessor symbols handy
  1232. Xecho " "
  1233. Xecho $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
  1234. X$cat <<EOSS >Cppsym
  1235. X$startsh
  1236. Xcase "\$1" in
  1237. X-l) list=true
  1238. X    shift
  1239. X    ;;
  1240. Xesac
  1241. Xunknown=''
  1242. Xcase "\$list\$#" in
  1243. X1|2)
  1244. X    for sym do
  1245. X    if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
  1246. X        exit 0
  1247. X    elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
  1248. X        :
  1249. X    else
  1250. X        unknown="\$unknown \$sym"
  1251. X    fi
  1252. X    done
  1253. X    set X \$unknown
  1254. X    shift
  1255. X    ;;
  1256. Xesac
  1257. Xcase \$# in
  1258. X0) exit 1;;
  1259. Xesac
  1260. Xecho \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
  1261. X#ifdef \1\\
  1262. Xexit 0; _ _ _ _\1\\     \1\\
  1263. X#endif\\
  1264. X/' >/tmp/Cppsym\$\$
  1265. Xecho exit 1 >>/tmp/Cppsym\$\$
  1266. X$cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  1267. Xcase "\$list" in
  1268. Xtrue) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  1269. X*)
  1270. X    sh /tmp/Cppsym2\$\$
  1271. X    status=\$?
  1272. X    ;;
  1273. Xesac
  1274. X$rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
  1275. Xexit \$status
  1276. XEOSS
  1277. Xchmod +x Cppsym
  1278. X$eunicefix Cppsym
  1279. Xecho "Your C preprocessor defines the following symbols:"
  1280. XCppsym -l $attrlist >Cppsym.true
  1281. Xcat Cppsym.true
  1282. Xrmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
  1283. X
  1284. X: see if this is a termio system
  1285. Xecho " "
  1286. Xif Cppsym pyr ; then
  1287. X    if $test "`/bin/universe`" = "ucb" ; then
  1288. X    if $test -r /usr/include/sgtty.h ; then
  1289. X        d_termio="$undef"
  1290. X        echo "sgtty.h found."
  1291. X    else
  1292. X        echo "System is a pyramid, and universe is bsd,"
  1293. X        echo "sgtty.h not found--you could have problems."
  1294. X    fi
  1295. X    else
  1296. X    if $test -r /usr/include/termio.h ; then
  1297. X        d_termio="$define"
  1298. X        echo "termio.h found."
  1299. X    else
  1300. X        echo "System is a pyramid, and universe is att,"
  1301. X        echo "termio.h not found--you could have problems."
  1302. X    fi
  1303. X    fi
  1304. Xelif $test -r /usr/include/termio.h ; then
  1305. X    d_termio="$define"
  1306. X    echo "termio.h found."
  1307. Xelif $test -r /usr/include/sgtty.h ; then
  1308. X    d_termio="$undef"
  1309. X    echo "sgtty.h found."
  1310. Xelse
  1311. X    d_termio="$undef"
  1312. X    echo "Neither termio.h nor sgtty.h found--you could have problems."
  1313. Xfi
  1314. X
  1315. X: see if struct tm is defined in sys/time.h
  1316. Xecho " "
  1317. Xif $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then
  1318. X    if $contains 'struct tm' /usr/include/sys/time.h >/dev/null 2>&1 ; then
  1319. X    echo "You have struct tm defined in both <time.h> and <sys/time.h>."
  1320. X        d_tminsys="$define"
  1321. X        timeincl=/usr/include/sys/time.h
  1322. X    else
  1323. X    echo "You have struct tm defined in <time.h> rather than <sys/time.h>."
  1324. X    if $contains 'include <time.h>' /usr/include/sys/time.h >/dev/null 2>&1; then
  1325. X        echo "but <sys/time.h> includes <time.h> so I'll include <sys/time.h>"
  1326. X        d_tminsys="$define"
  1327. X        timeincl='/usr/include/sys/time.h /usr/include/time.h'
  1328. X    else
  1329. X        d_tminsys="$undef"
  1330. X        timeincl=/usr/include/time.h
  1331. X    fi
  1332. X    fi
  1333. Xelse
  1334. X    echo "You have struct tm defined in <sys/time.h> rather than <time.h>."
  1335. X    d_tminsys="$define"
  1336. X    timeincl=/usr/include/sys/time.h
  1337. Xfi
  1338. X$cat $timeincl | $cppstdin $cppminus > try.c 2>&1
  1339. Xif $contains 'tz_minuteswest' try.c > /dev/null 2>&1 ; then
  1340. X    echo "You have tz_minuteswest defined in $timeincl rather than timezone."
  1341. X    d_tz_min="$define"
  1342. Xelse
  1343. X    echo "You have timezone defined in $timeincl rather than tz_minuteswest."
  1344. X    d_tz_min="$undef"
  1345. Xfi
  1346. X$rm -f try.c
  1347. X: check for valid reply/to fields
  1348. Xcase "$d_useembed" in
  1349. X"$define")    dflt=y;;
  1350. X"$undef")    dflt=n;;
  1351. X*)        dflt=n;;
  1352. Xesac
  1353. X$cat <<EOM
  1354. XOne of the more annoying quirks of the UUCP network and various other
  1355. Xsystems that interact with it are that everyone seems to have different
  1356. Xideas about how to do routing, etc.  Therefore, a lot of times email
  1357. Xwill arrive from offsite with corrupt, unreply-able "Reply-To:" and
  1358. X"From:" fields.  This next question relates to whether your site is
  1359. Xliable to get mangled fields or not...
  1360. X
  1361. XDoes your site receive email with valid "Reply-To:" and "From:" fields?
  1362. X
  1363. XEOM
  1364. X$echo $n "Use Reply-To: and From: addresses? [$dflt] $c"
  1365. Xrp="Are Reply-to: and From: addresses reliable? [$dflt]"
  1366. X. myread
  1367. Xcase "$ans" in
  1368. Xy*) d_useembed="$define";;
  1369. X*)  d_useembed="$undef";;
  1370. Xesac
  1371. X
  1372. X: check for utimbuf structure
  1373. Xecho " "
  1374. Xcase "$d_utimbuf" in
  1375. X"$define")    ;;
  1376. X"$undef")    ;;
  1377. X*)
  1378. X: Pyramid passes the att compile test but still needs the definition
  1379. X    if Cppsym pyr ; then
  1380. X        if $test "`/bin/universe`" = "att" ; then
  1381. X        d_utimbuf="$define"
  1382. X        echo "I will use my 'utimbuf' structure..."
  1383. X            fi
  1384. X        fi
  1385. X    if $test "$d_utimbuf" != "$define"; then
  1386. X        echo "Checking to see if struct utimbuf exists."
  1387. X        $cat >try.c <<'EOCP'
  1388. X#include <stdio.h>
  1389. X#include <fcntl.h>
  1390. X#include <sys/types.h>
  1391. X#include <sys/stat.h>
  1392. X#define far /* to keep XENIX from complaining */
  1393. X#include <sys/file.h>
  1394. X#include <time.h>
  1395. Xmain()
  1396. X{
  1397. Xstruct utimbuf test;
  1398. Xexit(1);
  1399. X}
  1400. XEOCP
  1401. X        if $cc try.c -o try >/dev/null 2>&1 ; then
  1402. X        d_utimbuf="$undef"
  1403. X        echo "You have the 'utimbuf' structure..."
  1404. X        else
  1405. X        echo "I will use my 'utimbuf' structure..."
  1406. X        d_utimbuf="$define"
  1407. X        fi
  1408. X        $rm -f try.c try.o try
  1409. X    fi
  1410. X    ;;
  1411. Xesac
  1412. X
  1413. X: see if there is a vfork
  1414. Xecho " "
  1415. Xif $contains '^vfork$' libc.list >/dev/null 2>&1 ; then
  1416. X    echo "vfork() found."
  1417. X    d_vfork="$undef"
  1418. Xelse
  1419. X    echo "No vfork() found--will use fork() instead."
  1420. X    d_vfork="$define"
  1421. Xfi
  1422. X
  1423. X: see if signal is declared as pointer to function returning int or void
  1424. Xecho " "
  1425. Xif $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then
  1426. X    echo "You have void (*signal())() instead of int."
  1427. X    d_voidsig="$define"
  1428. Xelse
  1429. X    echo "You have int (*signal())() instead of void."
  1430. X    d_voidsig="$undef"
  1431. Xfi
  1432. X
  1433. X: get user and system aliases sizes
  1434. X$cat <<EOM
  1435. XThe number of aliases allowed for users of the Elm system can vary
  1436. Xbased on system speed and memory available.  If you have a fast system
  1437. Xand/or a lot of memory you can enter a fairly large number of aliases
  1438. Xfor the next two questions...if not, you'll probably want to enter the
  1439. Xsuggested small-system values.  (This applies to the speed of the
  1440. Xswapping on your system too - if you're on a FAST system, use the big
  1441. Xvalues!)
  1442. X
  1443. XFirst, how many aliases should be allowed for an individual user?
  1444. XThe suggested values are 503 for blindly fast systems,
  1445. X251 for average systems and 127 for slow systems.
  1446. XEOM
  1447. X
  1448. Xcase "$maxuseralias" in
  1449. X    '') dflt=251;;
  1450. X    *)  dflt=$maxuseralias;;
  1451. Xesac
  1452. Xcont=true
  1453. Xwhile $test "$cont" ; do
  1454. X    echo " "
  1455. X    rp="Number of user aliases: [$dflt]"
  1456. X    $echo $n "$rp $c"
  1457. X    . myread
  1458. X    maxuseralias="$ans"
  1459. X    if $test "$maxuseralias" -lt 50 -o "$maxuseralias" -gt 1000 ; then
  1460. X    $cat <<EOM
  1461. XPretty strange answer!  I think you should reconsider and try a number
  1462. Xfrom the range 50-1000.
  1463. XEOM
  1464. X    odflt=$dflt
  1465. X    dflt=n
  1466. X    rp="Should I use your answer of $maxuseralias user aliases anyway? [$dflt]"
  1467. X    $echo $n "$rp $c"
  1468. X    . myread
  1469. X    dflt=$odflt
  1470. X    case "$ans" in
  1471. X    y*) cont='';;
  1472. X    esac
  1473. X    else
  1474. X    cont=''
  1475. X    fi
  1476. Xdone
  1477. X
  1478. Xcase "$maxsysalias" in
  1479. X    '') case "$maxuseralias" in
  1480. X    127) dflt=223;;
  1481. X    503) dflt=739;;
  1482. X    *  ) dflt=503;;
  1483. X    esac
  1484. X    ;;
  1485. X    *)  dflt=$maxsysalias;;
  1486. Xesac
  1487. Xcont=true
  1488. Xwhile $test "$cont" ; do
  1489. X    echo " "
  1490. X    rp="Maximum number of system aliases: [$dflt]"
  1491. X    $echo $n "$rp $c"
  1492. X    . myread
  1493. X    maxsysalias="$ans"
  1494. X    if $test "$maxsysalias" -lt 50 -o "$maxsysalias" -gt 1000 ; then
  1495. X    $cat <<EOM
  1496. XPretty strange answer!  I think you should reconsider and try a number
  1497. Xfrom the range 50-1000.
  1498. XEOM
  1499. X    odflt=$dflt
  1500. X    dflt=n
  1501. X    rp="Should I use your answer of $maxsysalias system aliases anyway? [$dflt]"
  1502. X    $echo $n "$rp $c"
  1503. X    . myread
  1504. X    dflt=$odflt
  1505. X    case "$ans" in
  1506. X    y*) cont='';;
  1507. X    esac
  1508. X    else
  1509. X    cont=''
  1510. X    fi
  1511. Xdone
  1512. Xelmalias="$maxsysalias"
  1513. X
  1514. X: preserve RCS keywords in files with variable substitution, grrr
  1515. XLog='$Log'
  1516. XHeader='$Header'
  1517. X
  1518. X: determine where public executables go
  1519. Xcase "$bin" in
  1520. X'')
  1521. X    dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  1522. X    ;;
  1523. X*)  dflt="$bin"
  1524. X    ;;
  1525. Xesac
  1526. Xcont=true
  1527. Xwhile $test "$cont" ; do
  1528. X    echo " "
  1529. X    rp="Where do you want to put the public executables? [$dflt]"
  1530. X    $echo $n "$rp $c"
  1531. X    . myread
  1532. X    bin="$ans"
  1533. X    bin=`filexp $bin`
  1534. X    if test -d $bin; then
  1535. X    cont=''
  1536. X    else
  1537. X    if $test "$fastread" = yes; then
  1538. X        dflt=y
  1539. X    else
  1540. X        dflt=n
  1541. X    fi
  1542. X    rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
  1543. X    $echo $n "$rp $c"
  1544. X    . myread
  1545. X    dflt=''
  1546. X    case "$ans" in
  1547. X    y*) cont='';;
  1548. X    esac
  1549. X    fi
  1550. Xdone
  1551. X
  1552. X: see if symlink exists
  1553. Xecho " "
  1554. Xif $contains '^symlink$' libc.list >/dev/null 2>&1; then
  1555. X    echo 'symlink() found.'
  1556. X    d_symlink="$define"
  1557. Xelse
  1558. X    echo 'symlink() not found.'
  1559. X    d_symlink="$undef"
  1560. Xfi
  1561. X
  1562. X: get default batch subject
  1563. X$cat <<EOM
  1564. XElm will provide a default subject for mail messages that are sent
  1565. Xin batch mode (redirected from a file.)
  1566. XEOM
  1567. X
  1568. Xcase "$defbatsub" in
  1569. X    '') dflt='no subject (file transmission)';;
  1570. X    *)  dflt=$defbatsub;;
  1571. Xesac
  1572. Xecho " "
  1573. Xrp="Default batch subject: [$dflt]"
  1574. X$echo $n "$rp $c"
  1575. X. myread
  1576. Xdefbatsub="$ans"
  1577. X
  1578. X: determine default editor
  1579. Xcase "$defeditor" in
  1580. X'')
  1581. X    case "$_vi" in
  1582. X    */*) dflt="$_vi";;
  1583. X    *) dflt=/usr/ucb/vi;;
  1584. X    esac
  1585. X    ;;
  1586. X*)  dflt="$defeditor"
  1587. X    ;;
  1588. Xesac
  1589. Xcont=true
  1590. Xwhile $test "$cont" ; do
  1591. X    echo " "
  1592. X    rp="What is the default editor on your system? [$dflt]"
  1593. X    $echo $n "$rp $c"
  1594. X    . myread
  1595. X    defeditor="$ans"
  1596. X    if $test -f $ans; then
  1597. X    cont=''
  1598. X    else
  1599. X    if $test "$fastread" = yes; then
  1600. X        dflt=y
  1601. X    else
  1602. X        dflt=n
  1603. X    fi
  1604. X    rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  1605. X    $echo $n "$rp $c"
  1606. X    . myread
  1607. X    dflt=''
  1608. X    case "$ans" in
  1609. X    y*) cont='';;
  1610. X    esac
  1611. X    fi
  1612. Xdone
  1613. X
  1614. X: determine where public libraries go
  1615. Xcase "$lib" in
  1616. X'')
  1617. X    dflt=`loc . "." /usr/local/lib /usr/lib /lib`
  1618. X    ;;
  1619. X*)  dflt="$lib"
  1620. X    ;;
  1621. Xesac
  1622. Xcont=true
  1623. Xwhile $test "$cont" ; do
  1624. X    echo " "
  1625. X    rp="Where do you want to put the public libraries? [$dflt]"
  1626. X    $echo $n "$rp $c"
  1627. X    . myread
  1628. X    lib="$ans"
  1629. X    lib=`filexp $lib`
  1630. X    if $test -d "$lib"; then
  1631. X    cont=''
  1632. X    else
  1633. X    dflt=n
  1634. X    rp="Directory $lib doesn't exist.  Use that name anyway? [$dflt]"
  1635. X    $echo $n "$rp $c"
  1636. X    . myread
  1637. X    dflt=''
  1638. X    case "$ans" in
  1639. X    y*) cont='';;
  1640. X    esac
  1641. X    fi
  1642. Xdone
  1643. X
  1644. X: ask the preferred line printer and options for this system.
  1645. Xcase "$linepr" in
  1646. X'')
  1647. X    if $test -f "$lp"; then
  1648. X    dflt="$lp"
  1649. X    elif $test -f "$lpr"; then
  1650. X    dflt="$lpr"
  1651. X    else
  1652. X    dflt=
  1653. X    fi
  1654. X    ;;
  1655. X*)  dflt="$linepr";;
  1656. Xesac
  1657. X
  1658. Xlinepr='blurfl/dyick'
  1659. X$cat <<EOM
  1660. X
  1661. XElm has an option to send messages to the printer.  This question
  1662. Xasks for the default spooler name.  You can also specify options
  1663. Xto the command by separating them from the command by at least one space. 
  1664. X
  1665. XEOM
  1666. Xcont=true
  1667. Xwhile $test "$cont" ; do
  1668. X    rp="What print spooler do you prefer to use with Elm? [$dflt]"
  1669. X    $echo $n "$rp $c"
  1670. X    . myread
  1671. X    linepr="$ans"
  1672. X    ans=`$expr "$linepr" : "\([^ ]*\).*"`
  1673. X    case "$ans" in
  1674. X    /*)
  1675. X    if $test -f "$ans"; then
  1676. X        cont=''
  1677. X    else
  1678. X        if $test "$fastread" = yes; then
  1679. X        dflt=y
  1680. X        else
  1681. X        dflt=n
  1682. X        fi
  1683. X        rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  1684. X        $echo $n "$rp $c"
  1685. X        . myread
  1686. X        case "$ans" in
  1687. X        y*) cont='';;
  1688. X        esac
  1689. X    fi
  1690. X    ;;
  1691. X    *)
  1692. X    echo "Please give the full path name."
  1693. X    ;;
  1694. X    esac
  1695. Xdone
  1696. X
  1697. X: determine where mail is spooled
  1698. Xcase "$maildir" in
  1699. X'')
  1700. X    dflt=`loc . /usr/spool/mail /usr/spool/mail /usr/mail`
  1701. X    ;;
  1702. X*)  dflt="$maildir"
  1703. X    ;;
  1704. Xesac
  1705. Xcont=true
  1706. Xwhile $test "$cont" ; do
  1707. X    echo " "
  1708. X    rp="Where is yet-to-be-read mail spooled? [$dflt]"
  1709. X    $echo $n "$rp $c"
  1710. X    . myread
  1711. X    maildir=`filexp "$ans"`
  1712. X    if test -d $maildir; then
  1713. X    cont=''
  1714. X    else
  1715. X    if $test "$fastread" = yes; then
  1716. X        dflt=y
  1717. X    else
  1718. X        dflt=n
  1719. X    fi
  1720. X    rp="Directory $maildir doesn't exist.  Use that name anyway? [$dflt]"
  1721. X    $echo $n "$rp $c"
  1722. X    . myread
  1723. X    dflt=''
  1724. X    case "$ans" in
  1725. X    y*) cont='';;
  1726. X    esac
  1727. X    fi
  1728. Xdone
  1729. X
  1730. X: determine mail delivery agent for Elm to use
  1731. Xcase "$mailer" in
  1732. X'')
  1733. X    if $test -f "$sendmail"; then
  1734. X    dflt="$sendmail"
  1735. X    elif $test -f "$rmail"; then
  1736. X    dflt="$rmail"
  1737. X    elif $test -f /bin/mail; then
  1738. X    dflt=/bin/mail
  1739. X    else
  1740. X    dflt=$mail
  1741. X    fi
  1742. X    ;;
  1743. X*)  dflt="$mailer";;
  1744. Xesac
  1745. Xcont=true
  1746. Xwhile $test "$cont" ; do
  1747. X    echo " "
  1748. X    echo "Give the full path name of the program used to deliver mail on your"
  1749. X    $echo $n "system: [$dflt] $c"
  1750. X    rp="Preferred mail delivery agent: [$dflt]"
  1751. X    . myread
  1752. X    mailer="$ans"
  1753. X    if $test -f "$ans"; then
  1754. X    cont=''
  1755. X    else
  1756. X    if $test "$fastread" = yes; then
  1757. X        dflt=y
  1758. X    else
  1759. X        dflt=n
  1760. X    fi
  1761. X    echo "Mail delivery agent $ans doesn't exist."
  1762. X    rp="Use that name anyway? [$dflt]"
  1763. X    $echo $n "$rp $c"
  1764. X    . myread
  1765. X    dflt=''
  1766. X    case "$ans" in
  1767. X    y*) cont='';;
  1768. X    esac
  1769. X    fi
  1770. Xdone
  1771. X
  1772. X: ask about setgid running of Elm
  1773. Xcase "$d_setgid" in
  1774. X"$define")    dflt=y;;
  1775. X"$undef")    dflt=n;;
  1776. X*)        dflt=y;;
  1777. Xesac
  1778. Xecho " "
  1779. Xrp="Am I going to be running as a setgid program? [$dflt]"
  1780. X$echo $n "$rp $c"
  1781. X. myread
  1782. Xcase "$ans" in
  1783. Xy*) d_setgid="$define";;
  1784. X*)  d_setgid="$undef";;
  1785. Xesac
  1786. Xcase "$d_setgid" in
  1787. X"$define")    mailermode=2755;;
  1788. X*)        mailermode=755;;
  1789. Xesac
  1790. X
  1791. X: determine the group of the mail directory- what group elm should use
  1792. Xmailgrp=`$ls -lgd $maildir`
  1793. Xmailgrp=`$expr "$mailgrp" : "d[rwxstS-]*[ 0123456789]*\(.*\)"`
  1794. X: now mailgrp is either    user group size mon day time/year name
  1795. X: or                       group size mon day time/year name
  1796. Xtry1=`$expr "$mailgrp" : "[A-z0-9]* *\([A-z0-9]*\).*"`
  1797. Xtry1a=`$expr "$try1" : "\([0-9]*\).*"`
  1798. Xif $test "$try1" = "$try1a"; then
  1799. X    mailgrp=`$expr "$mailgrp" : "\([A-z0-9]*\).*"`
  1800. Xelse
  1801. X    mailgrp="$try1"
  1802. Xfi
  1803. Xcase "$mailgrp" in
  1804. X'')
  1805. X    mailgrp=mail
  1806. X    ;;
  1807. Xesac
  1808. Xecho " "
  1809. Xecho "Mail group is $mailgrp"
  1810. X
  1811. X: ask the preferred pager for this system.
  1812. Xcase "$pager" in
  1813. X'') dflt="builtin+";;
  1814. X*)  dflt="$pager";;
  1815. Xesac
  1816. X
  1817. Xpager='blurfl/dyick'
  1818. Xecho " "
  1819. Xcont=true
  1820. Xwhile $test "$cont" ; do
  1821. X    rp="What pager do you prefer to use with Elm? [$dflt]"
  1822. X    $echo $n "$rp $c"
  1823. X    . myread
  1824. X    pager="$ans"
  1825. X    case "$ans" in
  1826. X    builtin)
  1827. X        cont=''
  1828. X    ;;
  1829. X    builtin+)
  1830. X        cont=''
  1831. X    ;;
  1832. X    /*)
  1833. X    if $test -f "$ans"; then
  1834. X        cont=''
  1835. X    else
  1836. X        if $test "$fastread" = yes; then
  1837. X        dflt=y
  1838. X        else
  1839. X        dflt=n
  1840. X        fi
  1841. X        rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  1842. X        $echo $n "$rp $c"
  1843. X        . myread
  1844. X        case "$ans" in
  1845. X        y*) cont='';;
  1846. X        esac
  1847. X    fi
  1848. X    ;;
  1849. X    *)
  1850. X    echo "Please give the full path name."
  1851. X    ;;
  1852. X    esac
  1853. Xdone
  1854. X
  1855. X: find out which shell people like to use most
  1856. Xcase "$prefshell" in
  1857. X'')
  1858. X    if $test -f /bin/ksh; then
  1859. X    dflt='/bin/ksh'
  1860. X    elif $test -f /bin/csh; then
  1861. X    dflt='/bin/csh'
  1862. X    else
  1863. X    dflt='/bin/sh'
  1864. X    fi
  1865. X    ;;
  1866. X*)  dflt="$prefshell";;
  1867. Xesac
  1868. Xcont=true
  1869. Xwhile $test "$cont" ; do
  1870. X    echo " "
  1871. X    echo "Give the full path name of the shell most people like to use on your"
  1872. X    $echo $n "system: [$dflt] $c"
  1873. X    rp="Preferred shell: [$dflt]"
  1874. X    . myread
  1875. X    prefshell=$ans
  1876. X    if test -f $ans; then
  1877. X    cont=''
  1878. X    else
  1879. X    if $test "$fastread" = yes; then
  1880. X        dflt=y
  1881. X    else
  1882. X        dflt=n
  1883. X    fi
  1884. X    rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  1885. X    $echo $n "$rp $c"
  1886. X    . myread
  1887. X    dflt=''
  1888. X    case "$ans" in
  1889. X    y*) cont='';;
  1890. X    esac
  1891. X    fi
  1892. Xdone
  1893. X
  1894. X: determine the name of the tape device
  1895. Xrmttape=`loc libcrypt.a "unknown-remote-tape-unit" /dev/rct /dev/rmt /dev/rtp`
  1896. Xecho "remote tape drive is $rmttape"
  1897. Xecho " "
  1898. X: determine text processor to use, default to troff if found.
  1899. Xcase "$roff" in
  1900. X'')
  1901. X    if $test -n "$troff"; then
  1902. X    dflt="$troff"
  1903. X    else
  1904. X    dflt=$nroff
  1905. X    fi
  1906. X    ;;
  1907. X*)  dflt="$roff";;
  1908. Xesac
  1909. X$cat <<EOM
  1910. X
  1911. XThe Elm manuals are set up for troff.  If you only have nroff, it can
  1912. Xbe used, but the manuals will not be as readable.  If you use an alternate
  1913. Xprocessor for troff/nroff documents it can be specified here.
  1914. X
  1915. XEOM
  1916. Xcont=true
  1917. Xwhile $test "$cont" ; do
  1918. X    echo " "
  1919. X    echo "Give the name of the program used to process manual pages on your"
  1920. X    $echo $n "system: [$dflt] $c"
  1921. X    rp="Preferred troff/nroff program: [$dflt]"
  1922. X    . myread
  1923. X    if $test -f "$ans"; then
  1924. X    cont=''
  1925. X    roff=$ans;
  1926. X    else
  1927. X    roff=`loc "$ans" "" . $pth`
  1928. X    if $test -f "$roff"; then
  1929. X        cont=''
  1930. X    else
  1931. X        if $test "$fastread" = yes; then
  1932. X        dflt=y
  1933. X        else
  1934. X        dflt=n
  1935. X        fi
  1936. X        echo "Text processor $ans doesn't exist."
  1937. X        rp="Use that name anyway? [$dflt]"
  1938. X        $echo $n "$rp $c"
  1939. X        . myread
  1940. X        dflt=''
  1941. X        case "$ans" in
  1942. X        y*) cont='';;
  1943. X        esac
  1944. X    fi
  1945. X    fi
  1946. Xdone
  1947. X
  1948. X: where do we get termlib routines from
  1949. Xecho " "
  1950. Xans=`loc libcurses.a x $libpth`
  1951. Xif $test "$ans" = x; then
  1952. X    ans=`loc Slibcurses.a x $libpth`
  1953. Xfi
  1954. Xcase "$ans" in
  1955. X/*)
  1956. X    ar t $ans >grimble
  1957. X    if $contains tputs.o grimble >/dev/null 2>&1; then
  1958. X    termlib='-lcurses'
  1959. X    d_havetlib="$define"
  1960. X    echo "Terminfo library found."
  1961. X    else
  1962. X    ans=x
  1963. X    fi
  1964. X    rm -f grimble
  1965. X    ;;
  1966. Xesac
  1967. Xcase "$ans" in
  1968. Xx)
  1969. X    ans=`loc libtermlib.a x $libpth`
  1970. X    if $test "$ans" = x; then
  1971. X    ans=`loc Slibtermlib.a x $libpth`
  1972. X    fi
  1973. X    case "$ans" in
  1974. X    /usr/lib*|/lib*)
  1975. X    termlib='-ltermlib'
  1976. X    d_havetlib="$define"
  1977. X    echo "Termlib library found."
  1978. X    ;;
  1979. X    /*)
  1980. X    termlib="$ans"
  1981. X    d_havetlib="$define"
  1982. X    echo "Termlib library found."
  1983. X    ;;
  1984. X    *)
  1985. X    ans=`loc libtermcap.a x $libpth`
  1986. X    if $test "$ans" = x; then
  1987. X        ans=`loc Slibtermcap.a x $libpth`
  1988. X    fi
  1989. X    case "$ans" in
  1990. X    /usr/lib*|/lib*)
  1991. X        termlib='-ltermcap'
  1992. X        d_havetlib="$define"
  1993. X        echo "Termcap library found."
  1994. X        ;;
  1995. X    /*)
  1996. X        termlib="$ans"
  1997. X        d_havetlib="$define"
  1998. X        echo "Termcap library found."
  1999. X        ;;
  2000. X    *)
  2001. X        case "$termlib" in
  2002. X        '')
  2003. X        dflt=y
  2004. X        rp="Your system appears to NOT have termlib-style routines.  Is this true? [$dflt]"
  2005. X        $echo $n "$rp $c"
  2006. X        . myread
  2007. X        case "$ans" in
  2008. X            n*|f*) d_havetlib="$define"
  2009. X              echo "Then where are the termlib-style routines kept (specify either -llibname"
  2010. X              $echo $n " or full pathname (~name ok))? $c"
  2011. X              rp='Specify termlib:'
  2012. X              . myread
  2013. X              termlib=`filexp $ans`
  2014. X              ;;
  2015. X            *)    d_havetlib="$undef"
  2016. X              termlib=''
  2017. X              echo "You will have to play around with term.c then."
  2018. X              ;;
  2019. X        esac
  2020. X        echo " "
  2021. X        ;;
  2022. X        *)  echo "You said termlib was $termlib before."
  2023. X        ;;
  2024. X        esac
  2025. X        ;;
  2026. X    esac
  2027. X    ;;
  2028. X    esac
  2029. X    ;;
  2030. Xesac
  2031. X
  2032. X: determine where temporary files should go
  2033. Xcase "$tmpdir" in
  2034. X'')
  2035. X    dflt=`loc . "." "/tmp /usr/tmp"`
  2036. X    ;;
  2037. X*)  dflt="$tmpdir"
  2038. X    ;;
  2039. Xesac
  2040. Xif $test -d "$tmpdir" -a "$tmpdir" != ""; then
  2041. X    $echo " "
  2042. X    $echo "Temporary files will be put in the $tmpdir directory"
  2043. Xelse
  2044. X    cont=true
  2045. X    while $test "$cont" ; do
  2046. X        $echo " "
  2047. X        rp="Where do you want to put the temporary files? [$dflt]"
  2048. X        $echo $n "$rp $c"
  2049. X        . myread
  2050. X        tmpdir="$ans"
  2051. X        tmpdir=`filexp $tmpdir`
  2052. X        if $test -d "$tmpdir" -a "$tmpdir" != ""; then
  2053. X        cont=''
  2054. X        else
  2055. X        if $test "$fastread" = yes; then
  2056. X            dflt=y
  2057. X        else
  2058. X            dflt=n
  2059. X        fi
  2060. X        rp="Directory $tmpdir doesn't exist.  Use that name anyway? [$dflt]"
  2061. X        $echo $n "$rp $c"
  2062. X        . myread
  2063. X        dflt=''
  2064. X        case "$ans" in
  2065. X        y*) cont='';;
  2066. X        esac
  2067. X        fi
  2068. X    done
  2069. Xfi
  2070. X
  2071. Xecho " "
  2072. Xecho "End of configuration questions."
  2073. Xecho " "
  2074. X
  2075. X: create config.sh file
  2076. Xecho " "
  2077. Xif test -d ../UU; then
  2078. X    cd ..
  2079. Xfi
  2080. Xecho "Creating config.sh..."
  2081. X$spitshell <<EOT >config.sh
  2082. X$startsh
  2083. X# config.sh
  2084. X# This file was produced by running the Configure script.
  2085. X
  2086. Xd_eunice='$d_eunice'
  2087. Xeunicefix='$eunicefix'
  2088. XLog='$Log'
  2089. XHeader='$Header'
  2090. Xcontains='$contains'
  2091. Xcppstdin='$cppstdin'
  2092. Xcppminus='$cppminus'
  2093. Xd_index='$d_index'
  2094. SHAR_EOF
  2095. echo "End of part 2"
  2096. echo "File Configure is continued in part 3"
  2097. echo "3" > s2_seq_.tmp
  2098. exit 0
  2099.  
  2100.